@page
@model BillsForRazorPages.Pages.Bills.IndexModel

@{ ViewData["Title"] = "Index"; }


<h1>Index</h1>
<form>
    <p>
        <select asp-for="BillCateGory" asp-items="Model.Categories">
            <option value="">ALL</option>
        </select>
        内容：<input type="text" asp-for="SearchString" />
        <input type="submit" value="Filter" />
    </p>
</form>
<p>
    <a asp-page="Create">Create New</a>
</p>
<table class="table">
    <thead>
        <tr>
            <th>
                @Html.DisplayNameFor(model => model.Bill[0].Content)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Bill[0].Price)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Bill[0].BillDate)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Bill[0].Category)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Bill[0].User)
            </th>
            <th></th>
        </tr>
    </thead>
    <tbody>
        @foreach (var item in Model.Bill)
        {
<tr>
    <td>
        @Html.DisplayFor(modelItem => item.Content)
    </td>
    <td>
        @Html.DisplayFor(modelItem => item.Price)
    </td>
    <td>
        @Html.DisplayFor(modelItem => item.BillDate)
    </td>
    <td>
        @Html.DisplayFor(modelItem => item.Category)
    </td>
    <td>
        @Html.DisplayFor(modelItem => item.User)
    </td>
    <td>
        <a asp-page="./Edit" asp-route-id="@item.Id">Edit</a> |
        <a asp-page="./Details" asp-route-id="@item.Id">Details</a> |
        <a asp-page="./Delete" asp-route-id="@item.Id">Delete</a>
    </td>
</tr>}
    </tbody>
</table>
